/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.z100h.supplychain.core.biz.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.jeeplus.core.persistence.BaseMapper;
import com.jeeplus.core.persistence.annotation.MyBatisMapper;
import com.z100h.supplychain.core.biz.entity.ResourceLog;

/**
 * 产品资源生命周期MAPPER接口
 *
 * @author madara
 * @version 2019-01-04
 */
@MyBatisMapper
public interface ResourceLogMapper extends BaseMapper<ResourceLog> {

	/**
	 * 批量插入资源日志
	 *
	 * @param resourceLog
	 */
	public void addBatchResourceLog(ResourceLog resourceLog);

	/**
	 * 根据凭据锁查询资源
	 *
	 * @param evidenceId
	 * @return
	 */
	public List<ResourceLog> findResourceLogByEvidenceId(String evidenceId);

	/**
	 *
	 * @param param
	 */
	public void confirmResourceLogging(Map<String, Object> param);

	/**
	 * 
	 * 功能实现描述
	 * 
	 * @param param
	 * @author: Elvin Zhao - 279152260@qq.com 
	 * @date: Created on 2019年4月8日 下午5:51:36
	 */
	public void confirmResourceLoggingByEid(Map<String, Object> param);

	/**
	 * 查询有多少资源未解锁
	 * @param param
	 * @return
	 */
	public Integer checkConfirmResourceLogging(Map<String, Object> param);

	/**
	 * 解锁
	 * @param param
	 */
	public void resourceLogging(Map<String, Object> param);

	/**
	 * 
	 * 出库日志记录
	 * 
	 * @param evidenceId
	 * @param resourceLockState
	 * @param resourceIds
	 * @author: Fyh - 1009173473@qq.com 
	 * @date: Created on 2019年3月20日 上午9:20:47
	 */
	public void stockoutResourceLogging(@Param("evidenceId") String evidenceId,
			@Param("resourceLockState") Integer resourceLockState, @Param("resourceIds") List<String> resourceIds);

	/**
	 * 
	 * 根据凭证id和skuid记录出库日志
	 * 
	 * @param evidenceId
	 * @param resourceLockState
	 * @param skuId
	 * @author: Fyh - 1009173473@qq.com 
	 * @date: Created on 2019年5月15日 上午11:03:57
	 */
	public void stockoutResourceLoggingBySkuIdAndEid(@Param("evidenceId") String evidenceId,
			@Param("resourceLockState") Integer resourceLockState, @Param("skuId") Integer skuId);

	public void stockoutResourceLoggingByErpSku(@Param("evidenceId") String evidenceId,
			@Param("erpResId") String erpResId, @Param("resourceLockState") Integer resourceLockState);

	public void stockoutResourceLoggingByErpResSku(@Param("evidenceId") String evidenceId,
			@Param("erpResId") String erpResId, @Param("skuId") Integer skuId,
			@Param("resourceLockState") Integer resourceLockState);

	public void updateLogEid(@Param("fromEvidenceId") String fromEvidenceId,
			@Param("toEvidenceId") String toEvidenceId);
}